Web transactions may involve a web server device transmitting a web document to a client device. The web document may be formatted in accordance with a markup language, such as the HyperText Markup Language (HTML). The web document may define static content and how this static content should be presented on a web page rendered by the client device. In some cases, parts of the web document are not known until the web document is about to be transmitted to the client device or until after this transmission takes place. Therefore, markup languages may also support dynamic content through embedded client-side scripts. These scripts may be delivered to the client device as part of the web document, and may be executed by a web browser on the client device. Such execution may cause the client device to carry out function calls, some of which may result in the client device transmitting requests for and receiving the dynamic content from the web server device or other devices. In this fashion, dynamic content can be combined with the static content of the web document, facilitating more flexibility in the types of information that can be provided to client devices.
A script may identify a function call as being synchronous or asynchronous. Accordingly, a request for dynamic content may be made synchronously or asynchronously. Synchronous requests are typically transmitted and executed in order, meaning that a synchronous request may require that the client device waits until the request is completed before the next request is sent. Asynchronous requests, on the other hand, may be transmitted at any time during or after the rendering of the web document for display as a web page. From a client-side performance and user experience standpoint, asynchronous requests may generally be preferred over synchronous requests because asynchronous requests may allow the web browser to load a web page more quickly and to perform other actions while a request is in the process of being completed. For instance, if one part of a web page is loading as a result of an asynchronous request for web content, a user may interact with and perform other operations related to the web page while the asynchronous request is being completed. On the other hand, the web server device may be subjected to communication and processing overhead for each asynchronous request that it receives.